import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import './assets/icon/iconfont.css'
import './common/config/routerConfig' // 全局配置
import './common/directive/btnPermissions'
import './common/directive/dialogDrag'
import Router from 'vue-router'
import utils from '@/common/util/utils'
import dayjs from 'dayjs'
import VueClipboard from 'vue-clipboard2'
import uploader from 'vue-simple-uploader'
// 引入Constant下所有js文件
const modules = require.context('./common/constant', true, /\.js$/)
let constant = {}
modules.keys().forEach(key => {
  const mod = modules(key)
  const content = mod.__esModule && mod.default ? mod.default : mod
  constant = { ...constant, ...content }
})
Vue.prototype.$dayjs = dayjs
Vue.prototype.$constant = constant
Vue.prototype.$utils = utils
// 禁止全局引入 echart
const routerPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return routerPush.call(this, location).catch(error => error)
}
// if (process.env.NODE_ENV !== 'production') require('@/mock')
Vue.config.productionTip = false
Vue.use(VueClipboard)
Vue.use(uploader)
Vue.use(ElementUI, { size: 'small', zIndex: 3000 })

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
